
#include "iostream"
#include "vector"
#include "unordered_map"
#include "algorithm"
#include "string"
#include "list"

class Solution{
public:
    int putchar_cnt=0;
    void putchar(char a){
        if(putchar_cnt==3){
            printf(" ");
            putchar_cnt=0;
        }
        printf("%c",a);
        putchar_cnt++;
    }
    void putchar_clear(){
        putchar_cnt=0;
    }
    void run(){
        std::string s;
        while(std::getline(std::cin,s)){
            bool is_word= true;
            char w;
            for(int i=0;i<s.size();i++){
                char c=s[i];
                if(c>='0'&&c<='9'){
                    for(int j=0;j<=c-'0';j++){
                        putchar(s[i+1]);
                    }
                    i++;
                }else{
                    putchar(c);
                }
            }
            printf("\n");
            putchar_clear();
        }
    }
};

int main() {
//    bool cur_num= true;
Solution().run();
    return 0;
}

